{layout name="layout" /}
<table class="pure-table">
    <thead>
        <tr>
            <th class="w100 fn-tac">商品编号</th>
            <th class="fn-tac w80">商品名称</th>
            <th></th>
            <th class="fn-tac w100">库存</th>
            <th class="fn-tac w160">成交奖励</th>
        </tr>
    </thead>
    <tbody>
        {foreach $lists as $key => $rs}
        <tr>
            <td class="fn-tac">{$rs.item_id}</td>
            <td class="fn-tac"><img src="{$rs.img}?x-oss-process=style/80" class="w60" /></td>
            <td>{$rs.name}</td>
            <td class="fn-tac"><span class="badge bg-blue fn-cp bar" url="{:url('entrust/giftcount',['page' => $page,'item_id'=>$rs.item_id])}" msg="【校准】您确认要校准数据吗?">{$rs.gite_count}</span></td>
            <td class="fn-tac">
                <button class="button bar" url="{:url('entrust/isgift',['page' => $page,'item_id'=>$rs.item_id])}" msg="【奖励】您确认要随机补贴吗?">随机</button>
                <button class="button button-blank win" url="{:url('entrust/usergift',['page' => $page,'item_id'=>$rs.item_id])}">指定</button>
            </td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
    Do('base', 'layer', function () {
        $(".bar").click(function () {
            var url = $(this).attr('url');      
            var msg = $(this).attr('msg');
            tools_submit({ action: url, msg: msg })
        })
        $(".win").click(function(){
            var url = $(this).attr('url');   
            parent.layer.open({type: 2,title: '成交补贴',maxmin: false,area: ['500px', '200px'],content: url,cancel: function (index, layero) {
                parent.layer.close(index);
                window.location.reload()
            }});
        });
    })
</script>